@layout("/common/_curd/_container.html"){

<script type="text/javascript">
	var ctx = "${basePath}";
	var grid_selector = "#grid-table";
	var pager_selector = "#grid-pager";
	
	$(function(){
        initGrid();
//		initMenuBtn("btns", "${code}");
	});
	
	function initGrid(){
		var grid_url = ctx + "/noticeResult/list";
		var _colnames = [
            "姓名",
            "是否已读",
						"查看时间"];
		var _colmodel = [
            {name:"customer_name", index:"customer_name", width:100},
            {name:"is_read", index:"is_read",formatter:fmtRead, width:100},
						{name:"ctime", index:"ctime", width:100}];

        var value = ${id};
        var key = "notice_id_equal";
        var where = "{\"" + key + "\":\"" + value + "\"}";
		
		jQuery(grid_selector).jqGrid({
			url : grid_url,
		    shrinkToFit : true,
			colNames : _colnames,
			colModel : _colmodel,
			multiselect: false,
			jsonReader : {id :"id"},
			pager : pager_selector,
			postData : {sort : "id", order : "desc", where: encodeURI(where)},
            loadComplete: function () {
                var table = this;
                setTimeout(function () {
                    updatePagerIcons(table);
                    //自适应表格高度 -- 表格初始化后调用
                    autoResize(grid_selector, 340);
                    $jqGrid = $(grid_selector);
                }, 0);
            }
		});
	}

    function  fmtRead(cellvalue, options, rowObject) {
        if (cellvalue==1){
            return '<span class="label label-sm label-success">已读</span>';
        }else{
            return '<span class="label label-sm label-warning">未读</span>';
        }
    }
</script>


	<!-- 配置 grid -->
	<div class="row">
		<div class="col-xs-12 tb-grid">
			<!-- 配置 查询 -->
			@ var _col=[
@		{name:"", index:"id", type:"text"},
			@		{name:"", index:"notice_id", type:"text"},
			@		{name:"", index:"customer_id", type:"text"},
			@		{name:"1老师2家长3学生", index:"customer_type", type:"text"},
			@		{name:"0未读1已读", index:"is_read", type:"text"},
			@		{name:"", index:"customer_name", type:"text"},
			@		{name:"", index:"sender_id", type:"text"},
			@		{name:"发送人", index:"sender", type:"text"},
			@		{name:"", index:"title", type:"text"},
			@		{name:"", index:"ctime", type:"text"}							
			@];
			<!--include("/common/_function/_search.html",{"col":_col}){}-->
			<!-- 按钮
			<div class="welljq well-sm" id="btns"></div>-->
			<!-- grid -->
			<table id="grid-table"></table>
			<!-- 分页-->
			<div id="grid-pager"></div>
		</div>
	</div>
	
	<!-- 引入所需的js -->
	@include("/common/_listscript.html"){}
	
@}	